home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk180 / arexxtutorial / usn / jeremy.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  967b  |  51 lines

  1. /* ARexx program - make sure the support library is open */
  2. options results
  3.  
  4. if exists('RAM:IN.TXT') then call delete('RAM:IN.TXT')
  5. if ~showlist('P','BAUD') then do
  6.    address command
  7.    'run BB:BaudBandit'
  8.    'waitforport BAUD'
  9.    address
  10.    kill = 1
  11. end
  12.  
  13. address 'BAUD'
  14.  
  15. BAUD 1200
  16. SEND 'ATDT12026530351\r'
  17. CAPT 'RAM:IN.TXT'
  18. WAIT UTC
  19. WAIT UTC
  20. call time('R')
  21. CAPT OFF
  22. SEND '\Ah'
  23.  
  24. address
  25.  
  26. if ~open('fh','RAM:IN.TXT') then do
  27.    say 'GetTime failed - ERROR 1'
  28.    exit 20
  29. end
  30.  
  31. do until eof('fh')
  32.    parse value readln('fh') with a1 a2 a3 a4 .
  33.    if a4 = 'UTC' then do
  34.       parse var a3 1 hours 3 mins 5 secs +2
  35.       hours = hours + 19
  36.       if hours > 23 then do
  37.          hours = hours - 24
  38.       end
  39.       secs = secs + time('E') % 1 + 1
  40.       address command ''date hours':'mins':'secs
  41.       address command ''setclock 'save'
  42.       ok = 1
  43.       leave
  44.    end
  45. end
  46.  
  47. if ok ~= 1 then say 'Mission failed!'
  48. if kill == 1 then address BAUD 'SEND \Aq'
  49.  
  50. /* end of program */
  51.